home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 February / macformat-047.iso / Demos / Picasso Interactive Demo / Data / dico.Dxr / 00001_Script Maître.ls next >
Encoding:
Text File  |  1996-12-04  |  4.6 KB  |  113 lines

  1. on startMovie
  2.   global g_dico_detect_letter, g_dico_detect_old_letter, g_dico_detect_old_mot, g_dico_cast_letter_lo, g_dico_cast_letter_hi, g_dico_sprite_letter, g_dico_sprite_old_letter, g_dico_sprite_mot, g_dico_cast_mot_lo, g_dico_cast_mot_hi, g_detect_mot, g_detect_old_mot, g_dico_sprite_def, g_dico_cast_def, g_dico_current_letter, g_dico_current_mot, g_dico_xfile, g_dico_detect_mot, g_dico_carte_liste, g_auto_init, g_call_param, g_dico_context, g_tempo, g_visite
  3.   set g_dico_carte_liste to [["A03", "F"], ["A09", "F"], ["B02", "E"], ["B04", "P"], ["B06", "F"], ["C01", "F"], ["C03", "F"], ["C05", "A", 99, 336], ["C06", "P"], ["C08", "A", 175, 71], ["C10", "E"], ["D03", "F"], ["D04", "A", 40, 286], ["E03", "A", 40, 157], ["F02", "A", 40, 126], ["F03", "A", 40, 319], ["G03", "E"], ["G04", "P"], ["H01", "E"], ["J02", "A", 39, 390], ["J03", "A", 31, 7], ["J04", "F"], ["L01", "P"], ["L05", "A", 91, 73], ["M01", "E"], ["M02", "E"], ["M03", "A", 129, 5], ["M04", "A", 40, 238], ["M06", "A", 100, 258], ["M10", "P"], ["M11", "F"], ["O02", "A", 40, 190], ["P01", "A", 100, 354], ["P02", "F"], ["P03", "A", 99, 211], ["R05", "F"], ["S06", "F"], ["V01", "F"], ["V02", "F"]]
  4.   set g_dico_letter to 0
  5.   set g_dico_detect_old_letter to -1
  6.   set g_dico_current_letter to -1
  7.   set g_dico_cast_letter_lo to 22
  8.   set g_dico_cast_letter_hi to 50
  9.   set g_dico_sprite_letter to 7
  10.   set g_dico_detect_old_mot to -1
  11.   set g_dico_cast_mot_lo to the number of member "A01ML.RTF"
  12.   set g_dico_cast_mot_hi to 78 + 15
  13.   set g_dico_cast_def to 5
  14.   set g_dico_sprite_def to 45
  15.   set g_dico_sprite_mot to 33
  16.   set g_dico_detect_mot to -1
  17.   set g_auto_init to 0
  18.   set g_visite to 0
  19.   if (g_call_param <> -1) and (length(g_call_param) <> 0) and (listp(g_call_param) = 0) then
  20.     set g_dico_detect_letter to charToNum(chars(g_call_param, 1, 1)) - 65
  21.     set g_dico_letter to g_dico_detect_letter
  22.     set g_dico_current_letter to g_dico_detect_letter
  23.     set g_detect_mot to value(chars(g_call_param, 2, 3)) - 1
  24.     set g_dico_mot to g_detect_mot
  25.     set g_dico_current_mot to g_detect_mot
  26.     set g_dico_detect_mot to g_detect_mot
  27.     set g_auto_init to 1
  28.   end if
  29.   if listp(g_call_param) = 1 then
  30.     set g_visite to 1
  31.     set mot to getAt(g_call_param, 1)
  32.     set g_tempo to getAt(g_call_param, 3)
  33.     set g_dico_detect_letter to charToNum(chars(mot, 1, 1)) - 65
  34.     set g_dico_letter to g_dico_detect_letter
  35.     set g_dico_current_letter to g_dico_detect_letter
  36.     set g_detect_mot to value(chars(mot, 2, 3)) - 1
  37.     set g_dico_mot to g_detect_mot
  38.     set g_dico_current_mot to g_detect_mot
  39.     set g_dico_detect_mot to g_detect_mot
  40.     set g_auto_init to 1
  41.   end if
  42.   put "dico g_call_param =", g_call_param
  43.   put "dico g_dico_context =", g_dico_context
  44. end
  45.  
  46. on HiLetter num, state
  47.   global g_dico_sprite_letter, g_dico_cast_letter_hi
  48.   if num <> -1 then
  49.     if state = 1 then
  50.       puppetSprite(g_dico_sprite_letter + num, 1)
  51.       set the castNum of sprite (g_dico_sprite_letter + num) to g_dico_cast_letter_hi + num
  52.     else
  53.       puppetSprite(g_dico_sprite_letter + num, 0)
  54.     end if
  55.   end if
  56. end
  57.  
  58. on HiMot num, state
  59.   global g_dico_cast_mot_hi, g_dico_cast_mot_lo, g_dico_sprite_mot
  60.   if num <> -1 then
  61.     if state = 1 then
  62.       if the castNum of sprite (g_dico_sprite_mot + num) <> (g_dico_cast_mot_hi + num) then
  63.         set the castNum of sprite (g_dico_sprite_mot + num) to g_dico_cast_mot_hi + num
  64.         set the visible of sprite (g_dico_sprite_mot + num) to 0
  65.         updateStage()
  66.         set the visible of sprite (g_dico_sprite_mot + num) to 1
  67.         updateStage()
  68.       end if
  69.     else
  70.       if the castNum of sprite (g_dico_sprite_mot + num) <> (g_dico_cast_mot_lo + num) then
  71.         set the castNum of sprite (g_dico_sprite_mot + num) to g_dico_cast_mot_lo + num
  72.         set the visible of sprite (g_dico_sprite_mot + num) to 0
  73.         updateStage()
  74.         set the visible of sprite (g_dico_sprite_mot + num) to 1
  75.         updateStage()
  76.       end if
  77.     end if
  78.   end if
  79. end
  80.  
  81. on unpuppet
  82.   repeat with i = 1 to 48
  83.     puppetSprite(i, 0)
  84.   end repeat
  85. end
  86.  
  87. on OwnPlay destination
  88.   global gOwnPlayList
  89.   if voidp(gOwnPlayList) then
  90.     set gOwnPlayList to []
  91.   end if
  92.   repeat with i = 1 to count(gOwnPlayList)
  93.     if getAt(getAt(gOwnPlayList, i), 1) = (the pathName & the movie) then
  94.       deleteAt(gOwnPlayList, i)
  95.     end if
  96.   end repeat
  97.   add(gOwnPlayList, [the pathName & the movie, the frame])
  98.   put "play ---> ", gOwnPlayList
  99.   go(1, destination)
  100. end
  101.  
  102. on OwnPlayDone
  103.   global gOwnPlayList
  104.   put "done ---> ", gOwnPlayList
  105.   set length to count(gOwnPlayList)
  106.   if length = 0 then
  107.     beep()
  108.     exit
  109.   end if
  110.   go(getAt(getAt(gOwnPlayList, length), 2), getAt(getAt(gOwnPlayList, length), 1))
  111.   deleteAt(gOwnPlayList, length)
  112. end
  113.